﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;

namespace UIT.Sample
{
    public class CustomObject : INotifyPropertyChanged
    {
        private string prop1;

        public string Prop1
        {
            get { return prop1; }
            set
            {
                prop1 = value;
                OnPropertyChanged("Prop1");
            }
        }

        private string prop2;

        public string Prop2
        {
            get { return prop2; }
            set
            {
                prop2 = value;
                OnPropertyChanged("Prop2");
            }
        }

        private CustomObject child;

        public CustomObject Child
        {
            get { return child; }
            set
            {
                child = value;
                OnPropertyChanged("Child");
            }
        }


        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        #endregion
    }
}